package com.slm.report.view.data;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.slm.report.db.ContentDataBean;

/**
 * @ProjectName: My Application
 * @Package: com.slm.report.view.data
 * @ClassName: BaseContentView
 * @Description: java类作用描述
 * @Author: 王丹丹
 * @CreateDate: 2020/6/1 10:59
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/6/1 10:59
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public abstract class BaseContentView extends LinearLayout {
    protected Context mContext;
    protected ContentDataBean contentDataBean;
    protected boolean isEdit=true;


    public BaseContentView(Context context) {
        super(context);
        mContext=context;
    }

    public BaseContentView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * 变更文本状态
     *
     * @param isEdit
     */
    public void upStatus(boolean isEdit) {
        this.isEdit = isEdit;
        if (contentDataBean != null) {
            upDataContent();
        }
    }

    abstract void upDataContent();

    public void setContentDataBean(ContentDataBean contentDataBean) {
        this.contentDataBean = contentDataBean;
        upDataContent();
    }
}
